Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish-foreign-env: suppress additional harmless warnings #31646

Merged
merged 1 commit into from Nov 16, 2017

Conversation

yrashk
Copy link
Contributor

@yrashk yrashk commented Nov 14, 2017

As per #30645, fish with fish-foreign-env prints this
(harmless) warning:

set: Tried to change the read-only variable “_”

This patch was developed by @rnhmjoj in the aforementioned
issue discussion

Motivation for this change

Warnings on shell startups are annoying

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@yrashk
Copy link
Contributor Author

yrashk commented Nov 14, 2017

Given the intricate relationship between fish and fish-foreign-env orchestrated by programs.fish, I wasn't able to test this patch. Any suggestions on how to do this are welcome.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Nov 14, 2017

Thank you. To test NixOS modules changes I generally do this:

  1. write a configuration sample to test.nix, in this case something like:
 { config, pkgs, ...}:

{
  networking.hostName = "vmhost";
  users.extraUsers.vm = {
    isNormalUser = true;
    password     = "vm";
    shell        = "${pkgs.fish}/bin/fish";
    extraGroups  = [ "wheel" ];
  };
  programs.fish.enable = true;
}
  1. Use nixos-rebuild -I nixpkgs=$HOME/src/nixpkgs -I nixos-config=$HOME/src/test.nix build-vm
    to build a virtual machine with the above configuration. (use the appropriate paths for nixpkgs and test.nix)

  2. Run ./result/bin/run-vmhost-vm to start the VM and test the changes.

It seems ok, could you just fix the indentation in the patch file?

As per NixOS#30645, fish with fish-foreign-env prints this
(harmless) warning:

```
set: Tried to change the read-only variable “_”
```

This patch was developed by @rnhmjoj in the aforementioned
issue discussion
@yrashk
Copy link
Contributor Author

yrashk commented Nov 14, 2017

@rnhmjoj thank you very much, this is indeed a perfect way to test it. I did it and everything worked great.

I also amended this PR for indentation, thanks for noticing!

yrashk added a commit to yrashk/nix-config that referenced this pull request Nov 15, 2017
Can't use it in a console or over ssh

Solution: using fish module allows it to work

It prints an annoying but harmless warning, though
(but this is going to be fixed with
NixOS/nixpkgs#31646)
@orivej orivej merged commit c8aa148 into NixOS:master Nov 16, 2017
yrashk added a commit to yrashk/nix-config that referenced this pull request Dec 5, 2017
Solution: use unstable fish-foreign-env

NixOS/nixpkgs#31646 resolved this
issue but it isn't part of stable yet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants